package com.igroupes.ovineherd.model.Style;

import com.igroupes.ovineherd.model.enums.FormKey;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

@EqualsAndHashCode(callSuper = true)
@Slf4j
@Data
@ToString(callSuper=true)
public class AddressStyle extends InputStyle {
    private boolean allowCity = true; // 允许选择城市
    private boolean allowDistrict = true; // 允许选择区域
    private boolean extractValue = true; //默认 true 是否抽取值，如果设置成 false 值格式会变成对象，包含 code、province、city 和 district 文字信息。
    protected AddressStyle(){
        super();
    }
    public AddressStyle(String label, Object value, Boolean required, boolean allowCity, boolean allowDistrict) {
        super(label, value,required);
        this.type = FormKey.ADDRESS.getCode();
        this.allowCity = allowCity;
        this.allowDistrict = allowDistrict;
    }

    @Override
    public Boolean verify(Object o) {
        super.verify(o);
        return true;
    }
}
